﻿using Mengsk.ProxyDelivery.Domain;
using Mengsk.ProxyDelivery.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace Mengsk.ProxyDelivery.Print.Domain.PrintDataFormatters
{
    class PrintDataFormatterReceivery_City : PrintDataFormatter
    {

        public override PrintTemplateItemTypes AcceptType
        {
            get { return PrintTemplateItemTypes.RECIVER_CITY; }
        }

        public override object Format(PrintTemplate template, PrintTemplateItem item, Order order)
        {
            var c = AddressService.ParseCity(order.ReceiverAddress);
            if (c == null)
            {
                return "";
            }
            return c.Name;
        }
    }
}
